package com.shruijin.wy.thread;

import com.shruijin.wy.thread.action.MathAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.annotation.Resource;

public class MathRunnable implements Runnable {

    Logger LOGGER  = LoggerFactory.getLogger(this.getClass());

    @Resource
    @Qualifier("action.math")
    MathAction mathAction;

    @Override
    public void run() {

        LOGGER.info(" {} ,is running!",Thread.currentThread().getName());
        try {
            mathAction.proccess(Thread.currentThread().getName());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
